﻿using NUnit.Framework;

namespace Minesweeper.Test {

    [TestFixture]
    public class ErzeugeMogenzettel {
        string[,] _minenfeld;

        [SetUp]
        public void Init() {
            string[,] minenfeld = 
            {
            {" ", " ", " ", " "},
            {" ", "*", " ", " "},
            {" ", " ", " ", " "},
            {"*", " ", " ", "*"},
            {" ", "*", " ", " "}
            };
            _minenfeld = minenfeld;
        }

        [Test]
        public void ErzeugeMogelzettelTest() {

            string [,] mogelzettel = Minesweeper.ErzeugeMogelzettel(_minenfeld);

            Assert.AreEqual("1", mogelzettel[0,0]);
            Assert.AreEqual("1", mogelzettel[0, 1]);
            Assert.AreEqual("1", mogelzettel[0, 2]);
            Assert.AreEqual("0", mogelzettel[0, 3]);
            Assert.AreEqual("1", mogelzettel[1, 0]);
            Assert.AreEqual("0", mogelzettel[1, 1]);
            Assert.AreEqual("1", mogelzettel[1, 2]);
            Assert.AreEqual("0", mogelzettel[1, 3]);
            Assert.AreEqual("2", mogelzettel[2, 0]);
            Assert.AreEqual("2", mogelzettel[2, 1]);
            Assert.AreEqual("2", mogelzettel[2, 2]);
            Assert.AreEqual("1", mogelzettel[2, 3]);
            Assert.AreEqual("1", mogelzettel[3, 0]);
            Assert.AreEqual("2", mogelzettel[3, 1]);
            Assert.AreEqual("2", mogelzettel[3, 2]);
            Assert.AreEqual("0", mogelzettel[3, 3]);
            Assert.AreEqual("2", mogelzettel[4, 0]);
            Assert.AreEqual("1", mogelzettel[4, 1]);
            Assert.AreEqual("2", mogelzettel[4, 2]);
            Assert.AreEqual("1", mogelzettel[4, 3]);
        }
    }
}